package com.nuoniu.sibanyun.mapper.cm;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nuoniu.sibanyun.entity.cm.ContractType;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  合同分类 Mapper 接口
 * </p>
 *
 * @author 小啊刚
 * @since 2021-10-20
 */
public interface ContractTypeMapper extends BaseMapper<ContractType> {

    /**
     * 根据名称获取分类
     * @author 小啊刚
     * @date 2021-10-21
     */
    @Select("select * from cm_contract_type where company_id=#{companyId} and name=#{name} limit 1")
    ContractType getByName(ContractType contractType);

    /**
     * 根据编码获取分类
     * @author 小啊刚
     * @date 2021-10-21
     */
    @Select("select * from cm_contract_type where company_id=#{companyId} and code=#{code} limit 1")
    ContractType getByCode(ContractType contractType);
}
